package demo;

import java.io.IOException;
import java.io.InputStream;

import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

public class Tianyancha {

	public static void main(String[] args) {
		
		StringBuffer out;
		try {
			CloseableHttpClient client = HttpClients.createDefault();
			HttpGet get = new HttpGet("");
			get.setHeader("Authorization", "RF9B2A06q6yn");
			CloseableHttpResponse response = client.execute(get);
			HttpEntity entity = response.getEntity();
			InputStream content2 = entity.getContent();
			out = new StringBuffer();
			byte[] b = new byte[4096];
			for (int n; (n = content2.read(b)) != -1;) {
				out.append(new String(b, 0, n));
			}
			System.out.println(out.toString());
		} catch (ClientProtocolException e) {
			e.printStackTrace();
		} catch (IllegalStateException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
		String result="{\"error_code\":0,\"reason\":\"ok\",\"result\":{\"total\":56,\"items\":[{\"id\":22822,\"regCapital\":\"217128 万人民币\",\"name\":\"<em>北京百度网讯科技有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2001-06-05 00:00:00.0\",\"legalPersonName\":\"梁志祥\",\"type\":1},{\"id\":23303972,\"regCapital\":\"100 万元 人民币\",\"name\":\"<em>北京</em>糯米<em>网科技</em>发展<em>有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2006-04-17 00:00:00.0\",\"legalPersonName\":\"金宇\",\"type\":1},{\"id\":711249800,\"regCapital\":\"-\",\"name\":\"<em>北京百度网讯科技有限公司</em>上海分公司\",\"base\":\"上海\",\"companyType\":1,\"estiblishTime\":\"2008-05-05 00:00:00.0\",\"legalPersonName\":\"向海龙\",\"type\":1},{\"id\":1615756664,\"regCapital\":\"-\",\"name\":\"<em>北京百度网讯科技有限公司</em>哈尔滨分公司\",\"base\":\"黑龙江\",\"companyType\":1,\"estiblishTime\":\"2012-05-08 00:00:00.0\",\"legalPersonName\":\"向海龙\",\"type\":1},{\"id\":139573020,\"regCapital\":\"-\",\"name\":\"<em>北京百度网讯科技有限公司</em>东莞分公司\",\"base\":\"广东\",\"companyType\":1,\"estiblishTime\":\"2008-05-15 00:00:00.0\",\"legalPersonName\":\"向海龙\",\"type\":1},{\"id\":139572971,\"regCapital\":\"-\",\"name\":\"<em>北京百度网讯科技有限公司</em>广州分公司\",\"base\":\"广东\",\"companyType\":1,\"estiblishTime\":\"2008-05-20 00:00:00.0\",\"legalPersonName\":\"向海龙\",\"type\":1},{\"id\":139573097,\"regCapital\":\"-\",\"name\":\"<em>北京百度网讯科技有限公司</em>南京分公司\",\"base\":\"江苏\",\"companyType\":1,\"estiblishTime\":\"2013-07-25 00:00:00.0\",\"legalPersonName\":\"赵坤\",\"type\":1},{\"id\":139572921,\"regCapital\":\"-\",\"name\":\"<em>北京百度网讯科技有限公司</em>深圳分公司\",\"base\":\"广东\",\"companyType\":1,\"estiblishTime\":\"2008-04-18 00:00:00.0\",\"legalPersonName\":\"向海龙\",\"type\":1},{\"id\":33015172,\"regCapital\":\"448.696007 万元 人民币\",\"name\":\"<em>北京</em>趣活<em>科技有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2012-03-07 00:00:00.0\",\"legalPersonName\":\"Yu Leslie\",\"type\":1},{\"id\":24643544,\"regCapital\":\"727.7928 万人民币\",\"name\":\"<em>北京</em>创新伙伴教育<em>科技有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2012-02-28 00:00:00.0\",\"legalPersonName\":\"韦晓亮\",\"type\":1},{\"id\":174626493,\"regCapital\":\"5026.4583万人民币\",\"name\":\"上海齐家<em>网</em>信息<em>科技</em>股份<em>有限公司</em>\",\"base\":\"上海\",\"companyType\":1,\"estiblishTime\":\"2007-08-09 00:00:00.0\",\"legalPersonName\":\"邓华金\",\"type\":1},{\"id\":24644208,\"regCapital\":\"2509.9865 万元 人民币\",\"name\":\"诺克萨斯（<em>北京</em>）<em>科技有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2012-12-04 00:00:00.0\",\"legalPersonName\":\"张伟华\",\"type\":1},{\"id\":3125216335,\"regCapital\":\"10000万人民币\",\"name\":\"<em>百度</em>雄安<em>科技有限公司</em>\",\"base\":\"河北\",\"companyType\":1,\"estiblishTime\":\"2017-12-01 00:00:00.0\",\"legalPersonName\":\"陈尚义\",\"type\":1},{\"id\":934605,\"regCapital\":\"3454.390700万人民币\",\"name\":\"<em>北京</em>太合音乐文化发展<em>有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2014-08-28 00:00:00.0\",\"legalPersonName\":\"钱实穆\",\"type\":1},{\"id\":2350111935,\"regCapital\":\"518.3251 万人民币\",\"name\":\"<em>北京</em>小<em>度</em>互娱<em>科技有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2016-04-01 00:00:00.0\",\"legalPersonName\":\"胡浩\",\"type\":1},{\"id\":2349015448,\"regCapital\":\"20000万人民币\",\"name\":\"沪江教育<em>科技</em>（上海）股份<em>有限公司</em>\",\"base\":\"上海\",\"companyType\":1,\"estiblishTime\":\"2009-03-12 00:00:00.0\",\"legalPersonName\":\"伏彩瑞\",\"type\":1},{\"id\":968162943,\"regCapital\":\"5376.0578 万人民币\",\"name\":\"客如云<em>科技</em>（<em>北京</em>）股份<em>有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2012-08-15 00:00:00.0\",\"legalPersonName\":\"彭雷\",\"type\":1},{\"id\":3174100,\"regCapital\":\"16000 万人民币\",\"name\":\"华扬联众数字<em>技</em>术股份<em>有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"1994-06-28 00:00:00.0\",\"legalPersonName\":\"苏同\",\"type\":1},{\"id\":2943685733,\"regCapital\":\"4961.0595 万人民币\",\"name\":\"首约<em>科技</em>（<em>北京</em>）<em>有限公司</em>\",\"base\":\"北京\",\"companyType\":1,\"estiblishTime\":\"2015-01-22 00:00:00.0\",\"legalPersonName\":\"周红\",\"type\":1},{\"id\":2358521463,\"regCapital\":\"8160.3261万人民币\",\"name\":\"美味不用等（上海）信息<em>科技</em>股份<em>有限公司</em>\",\"base\":\"上海\",\"companyType\":1,\"estiblishTime\":\"2013-01-29 00:00:00.0\",\"legalPersonName\":\"谢新法\",\"type\":1}]}}"; 
	
	
	}
}
